package cn.tedu.fresheveryday.mapper;

import cn.tedu.fresheveryday.pojo.entity.OrderOperation;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderOperationMapper {
    /**
     * 通过订单的状态查询订单操作
     * @param statusId 订单的状态id
     * @return
     */
    @Select(
            "select id, name, request_url, method, func from order_operation " +
            "where id in (" +
                "select operation_id from order_status_operation " +
                "where status_id = #{statusId}" +
            ")"
    )
    List<OrderOperation> selectByStatusId(int statusId);
}